package com.bonc.utils;

import java.sql.Connection;
import java.sql.DriverManager;
public class DBUtils {

    public String driver;//定义驱动
    public String url;//定义URL
    public String user;//定义用户名
    public String password;//定义密码
    public Connection conn;//定义连接

    public Connection getConn(){

        try {
            driver="com.mysql.jdbc.Driver";
            url="jdbc:mysql://10.0.93.25:3306/boncPaas";
            user="root";
            password="root";
            Class.forName(driver);
            conn = DriverManager.getConnection(url,user,password);
            System.out.println("-------连接成功------");
        } catch (Exception e) {
            e.printStackTrace();
        }

        return this.conn;
    }

}
